#include "RegExpTest.h"
#include "assert.h"

RegExpTest::RegExpTest()
{
}

RegExpTest::~RegExpTest()
{
}

void RegExpTest::testProgram() 
{
	cout<<"Reguliere Expressie Test"<<endl << "==================================="<<endl<<endl;

	Regexp *expr1, *expr2, *expr3, *expr4, *expr5, *expr6, *a, *b, *c, *d, *all;
	
	//a or b
	a = new Regexp("a");
	b = new Regexp("b");
	c = (a->or(b));
	cout << "Dit is a or b: " << endl << c->getLanguage(5) <<endl<<endl;
	cout<< "------------------------------------------------------------------------------" << endl<<endl;
	//a or b *
	all = (a->or(b)->star());
	cout << "Dit is a or b*: " << endl << all->getLanguage(3) << endl;
	cout<< "------------------------------------------------------------------------------" << endl<<endl;
	//baa or bb
	expr1 = new Regexp("baa");
	expr2 = new Regexp("bb");
	expr3 = (expr1->or(expr2));
	cout << "Dit is baa or bb: "<< endl << expr3->getLanguage(5) << endl;
	cout<< "------------------------------------------------------------------------------" << endl<<endl;
	//begint met abb en bevat baab
	expr4 = new Regexp("abb");
	expr5 = new Regexp("baab");
	expr6 = (expr4->dot(a->or(b))->dot(expr5)->dot(a->or(b)->star()));
	cout << "Dit is begint met abb en bevat baab: "<< endl << expr6->getLanguage(5) << endl;


	cout << endl<<endl;
}
